package be.ipl.diapero.daoimpl;

import javax.ejb.Stateless;

import be.ipl.diapero.dao.TourDao;
import be.ipl.diapero.domaine.Tour;

@Stateless
@SuppressWarnings("serial")
public class TourDaoImpl extends DaoImpl<Integer, Tour> implements TourDao {

	@Override
	public Tour chargerDesLances(Tour tour) {
		tour = rechercher(tour.getId());
		tour.getDesLances().size();
		return tour;
	}

	@Override
	public Tour chargerActions(Tour tour) {
		tour = rechercher(tour.getId());
		tour.getActions().size();
		return tour;
	}

	@Override
	public Tour rechercherTour(int partieId, int numero) {
		String queryString = "select t from Tour t where t.numero = ?1 AND partie_id = ?2";
		return recherche(queryString, numero, partieId);
	}
}
